FROM openresty/openresty
RUN cd /etc/nginx/conf.d
RUN mkdir -p /usr/local/openresty/nginx/lua
ADD ./dispatch.lua /usr/local/openresty/nginx/lua/
ADD ./img /usr/local/openresty/nginx/html/
RUN sed -i '22,25d' default.conf
RUN sed -i "22a\    location / {" default.conf
RUN sed -i "22a\	proxy_pass https://cloud.xinje.net;" default.conf
RUN sed -i "22a\	add_header Cache-Control no-store;" default.conf
RUN sed -i "22a\	body_filter_by_lua_file /etc/nginx/lua/dispatch.lua;" default.conf
RUN sed -i "22a\    }" default.conf

RUN sed -i "22a\	location  /img/login-bg.4a5669ff.png {" default.conf
RUN sed -i "22a\    root /usr/local/openresty/nginx/html;" default.conf
RUN sed -i "22a\	add_header Cache-Control no-store;" default.conf
RUN sed -i "22a\    index  index.html index.htm;" default.conf
RUN sed -i "22a\	}" default.conf


